//
//  TRView.m
//  SafePay
//
//  Created by  ztryxh on 2018/6/15.
//  Copyright © 2018年 ebo. All rights reserved.
//

#import "TRView.h"
#import <ReactiveObjC.h>
#import "AppDelegate.h"
@implementation TRView
-(instancetype)init{
    
    self=[super init];
    if(self){
        
        [self tr_setupViews];
        [self tr_bindViewModel];
    }
    return self;
}
-(instancetype)initWithViewModel:(id<TRViewModelProtocol>)viewModel
{
    self=[super init];
    if(self){
        
        [self tr_setupViews];
        [self tr_bindViewModel];
        
    }
    return self;
}
-(void)tr_bindViewModel{
    
    
}
-(void)tr_setupViews{
    
    
}
-(void)tr_addReturnKeyBoard{
    
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
    tap.numberOfTapsRequired = 1;
    tap.numberOfTouchesRequired = 1;
    [tap.rac_gestureSignal subscribeNext:^(id x) {
        
        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
        [appDelegate.window endEditing:YES];
    }];
    [self addGestureRecognizer:tap];
    
}
@end
